package com.itheima;

import com.itheima.config.DatasourceConfig;
import com.itheima.config.SpringConfig;
import com.itheima.dao.UserDao;
import com.itheima.pojo.User;
import com.itheima.service.ProductService;
import com.itheima.service.UserService;
import com.itheima.xyz.X;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import javax.sql.DataSource;

/**
 * @author huyoufu <https://github.com/huyoufu>
 * @TIME 2020-08-06 09:20
 * @description
 */
public class Test01 {
    public static void main(String[] args) {
        //你创建另外容器对象的子类
        //基于注解的容器类
        ApplicationContext context=new AnnotationConfigApplicationContext(SpringConfig.class);

        DataSource dataSource = context.getBean(DataSource.class);
        System.out.println("获取datasource对象:"+dataSource);


    }
}
